package mock.action;
import java.util.*;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.Action;

public class GovOfficeRegionAction {
	private String sEcho = null;
	private Integer iTotalRecords = null;
	private Integer iTotalDisplayRecords = null;
	private List<ArrayList<String>> aaData = null;
	
	public String execute(){
		//specify values for sEcho, iTotalRecords, iTotalDisplayRecords
		sEcho = ServletActionContext.getRequest().getParameter("sEcho");
		iTotalRecords = new Integer(100);
		iTotalDisplayRecords = new Integer(50);
		
		//specify values for table Data
		aaData = new ArrayList<ArrayList<String>>();
		for(int i = 0; i<50; i++){
			ArrayList<String> row = new ArrayList<String>();
			row.add("<img src='tablemedia/images/details_open.png'>");
			row.add("Region name "+i);
			row.add("Description "+i);
			row.add("Yes");
			aaData.add(row);
		}
		return Action.SUCCESS;
	}

	public String getsEcho() {
		return sEcho;
	}

	public void setsEcho(String sEcho) {
		this.sEcho = sEcho;
	}

	public Integer getiTotalRecords() {
		return iTotalRecords;
	}

	public void setiTotalRecords(Integer iTotalRecords) {
		this.iTotalRecords = iTotalRecords;
	}

	public Integer getiTotalDisplayRecords() {
		return iTotalDisplayRecords;
	}

	public void setiTotalDisplayRecords(Integer iTotalDisplayRecords) {
		this.iTotalDisplayRecords = iTotalDisplayRecords;
	}

	public List<ArrayList<String>> getAaData() {
		return aaData;
	}

	public void setAaData(List<ArrayList<String>> aaData) {
		this.aaData = aaData;
	}
}
